package com.wish.wishsystem_management.controller;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wish.wishsystem_management.api.SysLog;
import com.wish.wishsystem_management.entity.SysMenu;
import com.wish.wishsystem_management.service.ISysMenuService;
import dto.systemDto.SysMenuDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import vo.ResultEntity;

import java.security.Principal;
import java.util.Arrays;
import java.util.List;

/**
 * <p>
 * 菜单管理 前端控制器
 * </p>
 *
 * @author zhaiwj
 * @since 2021-03-22
 */
@RestController
@RequestMapping("/system/sysMenu")
@Slf4j
public class MenuController {

    //菜单service
    @Autowired
    private ISysMenuService iSysMenuService;

    @GetMapping("/getMenus")
    public ResultEntity getMenus(Principal member) {

        String name = member.getName();
        List<SysMenu> menus = iSysMenuService.getMenus(name);
        return ResultEntity.ok(menus);
    }

}

